package cn.ichiva.tushare.sdk.tushare.entity;

import cn.ichiva.tushare.sdk.common.SystemHelper;
import lombok.Data;

@Data
public class TuResponse {
    private int code;
    private TuTable data;
    private String msg;

    public String toString(){
        StringBuffer buffer = new StringBuffer("code:" + code + SystemHelper.getLineEnd());
        for (String field : data.getFields()) {
            buffer.append(field).append("\t");
        }
        buffer.append(SystemHelper.getLineEnd());

        for (String[] item : data.getItems()) {
            for (String field : item) {
                buffer.append(field).append("\t");
            }
            buffer.append(SystemHelper.getLineEnd());
        }

        buffer.append("msg:").append(msg);

        return buffer.toString();
    }
}
